package com.card.repository;

import java.util.List;

import javax.transaction.Transactional;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.card.entity.system.Card;
import com.card.entity.system.Customer;

/**
 * ClassName: ICustomerRepository <br/>
 * Function: 客户. <br/>
 * date: 2018年10月16日 下午7:14:14 <br/>
 * 
 * @author lishuai11
 * @version
 * @since JDK 1.8
 */
@Transactional
public interface ICustomerRepository
		extends PagingAndSortingRepository<Customer, Integer>, JpaSpecificationExecutor<Customer> {

	@Query(nativeQuery = true, value = "SELECT s.* FROM customer s ORDER BY s.createdtime DESC limit ?1,?2")
	List<Card> pageSearch(int pageNum, int pageSize);

	List<Customer> findByCustomeMobile(String customeMobile);
}
